//
//  StatusesHomeModel.swift
//  MQLWeibo
//
//  Created by MQL-IT on 2016/11/10.
//  Copyright © 2016年 MQL-IT. All rights reserved.
//

import Foundation
import SwiftyJSON

class StatusesHomeModel : NSObject {
    
    var ad : [AnyObject]!
    var advertises : [AnyObject]!
    var hasUnread : Int!
    var hasvisible : Bool!
    var interval : Int!
    var maxId : Int!
    var nextCursor : Int!
    var previousCursor : Int!
    var sinceId : Int!
    var statuses : [StatuseModel]!
    var totalNumber : Int!
    var uveBlank : Int!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        ad = [AnyObject]()
        let adArray = json["ad"].arrayValue
        for adJson in adArray{
            ad.append(adJson.stringValue as AnyObject)
        }
        advertises = [AnyObject]()
        let advertisesArray = json["advertises"].arrayValue
        for advertisesJson in advertisesArray{
            advertises.append(advertisesJson.stringValue as AnyObject)
        }
        hasUnread = json["has_unread"].intValue
        hasvisible = json["hasvisible"].boolValue
        interval = json["interval"].intValue
        maxId = json["max_id"].intValue
        nextCursor = json["next_cursor"].intValue
        previousCursor = json["previous_cursor"].intValue
        sinceId = json["since_id"].intValue
        statuses = [StatuseModel]()
        let statusesArray = json["statuses"].arrayValue
        for statusesJson in statusesArray{
            let value = StatuseModel(fromJson: statusesJson)
            statuses.append(value)
        }
        totalNumber = json["total_number"].intValue
        uveBlank = json["uve_blank"].intValue
    }
}




class StatuseModel : NSObject {
    
    var attitudesCount : Int!
    var bizFeature : Int!
    var bmiddlePic : String!
    var cardid : String!
    var commentsCount : Int!
    var createdAt : String!
    var darwinTags : [AnyObject]!
    var favorited : Bool!
    var geo : AnyObject!
    var gifIds : String!
    var hasActionTypeCard : Int!
    var hotWeiboTags : [AnyObject]!
    var id : Int!
    var idstr : String!
    var inReplyToScreenName : String!
    var inReplyToStatusId : String!
    var inReplyToUserId : String!
    var isLongText : Bool!
    var isShowBulletin : Int!
    var mid : String!
    var mlevel : Int!
    var originalPic : String!
    var picUrls : [PicUrl]!
    var positiveRecomFlag : Int!
    var repostsCount : Int!
    var retweetedStatus : RetweetedStatu!
    var rid : String!
    var source : String!
    var sourceAllowclick : Int!
    var sourceType : Int!
    var text : String!
    var textLength : Int!
    var textTagTips : [AnyObject]!
    var thumbnailPic : String!
    var truncated : Bool!
    var user : User!
    var userType : Int!
    var visible : Visible!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        attitudesCount = json["attitudes_count"].intValue
        bizFeature = json["biz_feature"].intValue
        bmiddlePic = json["bmiddle_pic"].stringValue
        cardid = json["cardid"].stringValue
        commentsCount = json["comments_count"].intValue
        createdAt = json["created_at"].stringValue
        darwinTags = [AnyObject]()
        let darwinTagsArray = json["darwin_tags"].arrayValue
        for darwinTagsJson in darwinTagsArray{
            darwinTags.append(darwinTagsJson.stringValue as AnyObject)
        }
        favorited = json["favorited"].boolValue
        geo = json["geo"].stringValue as AnyObject!
        gifIds = json["gif_ids"].stringValue
        hasActionTypeCard = json["hasActionTypeCard"].intValue
        hotWeiboTags = [AnyObject]()
        let hotWeiboTagsArray = json["hot_weibo_tags"].arrayValue
        for hotWeiboTagsJson in hotWeiboTagsArray{
            hotWeiboTags.append(hotWeiboTagsJson.stringValue as AnyObject)
        }
        id = json["id"].intValue
        idstr = json["idstr"].stringValue
        inReplyToScreenName = json["in_reply_to_screen_name"].stringValue
        inReplyToStatusId = json["in_reply_to_status_id"].stringValue
        inReplyToUserId = json["in_reply_to_user_id"].stringValue
        isLongText = json["isLongText"].boolValue
        isShowBulletin = json["is_show_bulletin"].intValue
        mid = json["mid"].stringValue
        mlevel = json["mlevel"].intValue
        originalPic = json["original_pic"].stringValue
        picUrls = [PicUrl]()
        let picUrlsArray = json["pic_urls"].arrayValue
        for picUrlsJson in picUrlsArray{
            let value = PicUrl(fromJson: picUrlsJson)
            picUrls.append(value)
        }
        positiveRecomFlag = json["positive_recom_flag"].intValue
        repostsCount = json["reposts_count"].intValue
        let retweetedStatusJson = json["retweeted_status"]
        if retweetedStatusJson != JSON.null{
            retweetedStatus = RetweetedStatu(fromJson: retweetedStatusJson)
        }
        rid = json["rid"].stringValue
        source = json["source"].stringValue
        sourceAllowclick = json["source_allowclick"].intValue
        sourceType = json["source_type"].intValue
        text = json["text"].stringValue
        textLength = json["textLength"].intValue
        textTagTips = [AnyObject]()
        let textTagTipsArray = json["text_tag_tips"].arrayValue
        for textTagTipsJson in textTagTipsArray{
            textTagTips.append(textTagTipsJson.stringValue as AnyObject)
        }
        thumbnailPic = json["thumbnail_pic"].stringValue
        truncated = json["truncated"].boolValue
        let userJson = json["user"]
        if userJson != JSON.null{
            user = User(fromJson: userJson)
        }
        userType = json["userType"].intValue
        let visibleJson = json["visible"]
        if visibleJson != JSON.null{
            visible = Visible(fromJson: visibleJson)
        }
    }
}

class RetweetedStatu : NSObject {
    
    var attitudesCount : Int!
    var bizFeature : Int!
    var bizIds : [Int]!
    var commentsCount : Int!
    var createdAt : String!
    var darwinTags : [AnyObject]!
    var favorited : Bool!
    var geo : AnyObject!
    var gifIds : String!
    var hasActionTypeCard : Int!
    var hotWeiboTags : [AnyObject]!
    var id : Int!
    var idstr : String!
    var inReplyToScreenName : String!
    var inReplyToStatusId : String!
    var inReplyToUserId : String!
    var isLongText : Bool!
    var isShowBulletin : Int!
    var mid : String!
    var mlevel : Int!
    var picUrls : [AnyObject]!
    var positiveRecomFlag : Int!
    var repostsCount : Int!
    var source : String!
    var sourceAllowclick : Int!
    var sourceType : Int!
    var text : String!
    var textLength : Int!
    var textTagTips : [AnyObject]!
    var truncated : Bool!
    var user : User!
    var userType : Int!
    var visible : Visible!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        attitudesCount = json["attitudes_count"].intValue
        bizFeature = json["biz_feature"].intValue
        bizIds = [Int]()
        let bizIdsArray = json["biz_ids"].arrayValue
        for bizIdsJson in bizIdsArray{
            bizIds.append(bizIdsJson.intValue)
        }
        commentsCount = json["comments_count"].intValue
        createdAt = json["created_at"].stringValue
        darwinTags = [AnyObject]()
        let darwinTagsArray = json["darwin_tags"].arrayValue
        for darwinTagsJson in darwinTagsArray{
            darwinTags.append(darwinTagsJson.stringValue as AnyObject)
        }
        favorited = json["favorited"].boolValue
        geo = json["geo"].stringValue as AnyObject!
        gifIds = json["gif_ids"].stringValue
        hasActionTypeCard = json["hasActionTypeCard"].intValue
        hotWeiboTags = [AnyObject]()
        let hotWeiboTagsArray = json["hot_weibo_tags"].arrayValue
        for hotWeiboTagsJson in hotWeiboTagsArray{
            hotWeiboTags.append(hotWeiboTagsJson.stringValue as AnyObject)
        }
        id = json["id"].intValue
        idstr = json["idstr"].stringValue
        inReplyToScreenName = json["in_reply_to_screen_name"].stringValue
        inReplyToStatusId = json["in_reply_to_status_id"].stringValue
        inReplyToUserId = json["in_reply_to_user_id"].stringValue
        isLongText = json["isLongText"].boolValue
        isShowBulletin = json["is_show_bulletin"].intValue
        mid = json["mid"].stringValue
        mlevel = json["mlevel"].intValue
        picUrls = [AnyObject]()
        let picUrlsArray = json["pic_urls"].arrayValue
        for picUrlsJson in picUrlsArray{
            picUrls.append(picUrlsJson.stringValue as AnyObject)
        }
        positiveRecomFlag = json["positive_recom_flag"].intValue
        repostsCount = json["reposts_count"].intValue
        source = json["source"].stringValue
        sourceAllowclick = json["source_allowclick"].intValue
        sourceType = json["source_type"].intValue
        text = json["text"].stringValue
        textLength = json["textLength"].intValue
        textTagTips = [AnyObject]()
        let textTagTipsArray = json["text_tag_tips"].arrayValue
        for textTagTipsJson in textTagTipsArray{
            textTagTips.append(textTagTipsJson.stringValue as AnyObject)
        }
        truncated = json["truncated"].boolValue
        let userJson = json["user"]
        if userJson != JSON.null{
            user = User(fromJson: userJson)
        }
        userType = json["userType"].intValue
        let visibleJson = json["visible"]
        if visibleJson != JSON.null{
            visible = Visible(fromJson: visibleJson)
        }
    }
}

class Visible : NSObject {
    
    var listId : Int!
    var type : Int!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        listId = json["list_id"].intValue
        type = json["type"].intValue
    }
}



class User : NSObject {
    
    var allowAllActMsg : Bool!
    var allowAllComment : Bool!
    var avatarHd : String!
    var avatarLarge : String!
    var biFollowersCount : Int!
    var blockApp : Int!
    var blockWord : Int!
    var city : String!
    var classField : Int!
    var coverImagePhone : String!
    var createdAt : String!
    var creditScore : Int!
    var descriptionField : String!
    var domain : String!
    var favouritesCount : Int!
    var followMe : Bool!
    var followersCount : Int!
    var following : Bool!
    var friendsCount : Int!
    var gender : String!
    var geoEnabled : Bool!
    var id : Int!
    var idstr : String!
    var lang : String!
    var location : String!
    var mbrank : Int!
    var mbtype : Int!
    var name : String!
    var onlineStatus : Int!
    var pagefriendsCount : Int!
    var profileImageUrl : String!
    var profileUrl : String!
    var province : String!
    var ptype : Int!
    var remark : String!
    var screenName : String!
    var star : Int!
    var statusesCount : Int!
    var urank : Int!
    var url : String!
    var userAbility : Int!
    var verified : Bool!
    var verifiedReason : String!
    var verifiedReasonUrl : String!
    var verifiedSource : String!
    var verifiedSourceUrl : String!
    var verifiedTrade : String!
    var verifiedType : Int!
    var weihao : String!
    var coverImage : String!
    var verifiedContactEmail : String!
    var verifiedContactMobile : String!
    var verifiedContactName : String!
    var verifiedLevel : Int!
    var verifiedReasonModified : String!
    var verifiedState : Int!
    var verifiedTypeExt : Int!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        allowAllActMsg = json["allow_all_act_msg"].boolValue
        allowAllComment = json["allow_all_comment"].boolValue
        avatarHd = json["avatar_hd"].stringValue
        avatarLarge = json["avatar_large"].stringValue
        biFollowersCount = json["bi_followers_count"].intValue
        blockApp = json["block_app"].intValue
        blockWord = json["block_word"].intValue
        city = json["city"].stringValue
        classField = json["class"].intValue
        coverImagePhone = json["cover_image_phone"].stringValue
        createdAt = json["created_at"].stringValue
        creditScore = json["credit_score"].intValue
        descriptionField = json["description"].stringValue
        domain = json["domain"].stringValue
        favouritesCount = json["favourites_count"].intValue
        followMe = json["follow_me"].boolValue
        followersCount = json["followers_count"].intValue
        following = json["following"].boolValue
        friendsCount = json["friends_count"].intValue
        gender = json["gender"].stringValue
        geoEnabled = json["geo_enabled"].boolValue
        id = json["id"].intValue
        idstr = json["idstr"].stringValue
        lang = json["lang"].stringValue
        location = json["location"].stringValue
        mbrank = json["mbrank"].intValue
        mbtype = json["mbtype"].intValue
        name = json["name"].stringValue
        onlineStatus = json["online_status"].intValue
        pagefriendsCount = json["pagefriends_count"].intValue
        profileImageUrl = json["profile_image_url"].stringValue
        profileUrl = json["profile_url"].stringValue
        province = json["province"].stringValue
        ptype = json["ptype"].intValue
        remark = json["remark"].stringValue
        screenName = json["screen_name"].stringValue
        star = json["star"].intValue
        statusesCount = json["statuses_count"].intValue
        urank = json["urank"].intValue
        url = json["url"].stringValue
        userAbility = json["user_ability"].intValue
        verified = json["verified"].boolValue
        verifiedReason = json["verified_reason"].stringValue
        verifiedReasonUrl = json["verified_reason_url"].stringValue
        verifiedSource = json["verified_source"].stringValue
        verifiedSourceUrl = json["verified_source_url"].stringValue
        verifiedTrade = json["verified_trade"].stringValue
        verifiedType = json["verified_type"].intValue
        weihao = json["weihao"].stringValue
        coverImage = json["cover_image"].stringValue
        verifiedContactEmail = json["verified_contact_email"].stringValue
        verifiedContactMobile = json["verified_contact_mobile"].stringValue
        verifiedContactName = json["verified_contact_name"].stringValue
        verifiedLevel = json["verified_level"].intValue
        verifiedReasonModified = json["verified_reason_modified"].stringValue
        verifiedState = json["verified_state"].intValue
        verifiedTypeExt = json["verified_type_ext"].intValue
    }
}



class PicUrl : NSObject {
    
    var thumbnailPic : String!
    
    
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        if json == nil{
            return
        }
        thumbnailPic = json["thumbnail_pic"].stringValue
    }
}


